home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / internet / wgizmo / wgizmo.txt < prev    next >
Encoding:
Text File  |  1996-01-09  |  11.2 KB  |  112 lines

  1. WinCGIzmo (tm)
  2. A WinCGI Counter+ Utility for Windows Websites
  3. A product of Hickory Hill Associates, Plantsville, CT, USA.
  4. http://www.hickoryhill.com/
  5.  
  6. I. Introduction
  7.  
  8.     Thank you for trying Hickory Hill's WinCGIzmo (tm).  This CGI (Common Gateway Interface) utility when executed from a WinCGI compatible Webserver, such as O'Reilly's Website, provides a dynamic counter utility for multiple webpages on your site, as well as a way to display today's date, time, the IP address of the browser, days until or since a specific date, or the host name of the browser, if available.  WinCGIzmo (tm) prepares and returns  a GIF image in response to a <IMG SRC="/cgi-winpath/wgizmo.exe?parameter-string"> HTML tag in the webpage.  You may have to reload or refresh the webpage with the browser to force recreation of the images.  You can also use it to display a simple graphical text box.  Examples of its use are found on our Website, http://www.hickoryhill.com/. 
  9.  
  10.     The software is written in Microsoft's Visual Basic 3.0, using the utilities provided with O'Reilly's Website 1.0.  WinCGIzmo (tm) requires four .DLL's, VBRUN300.DLL, MSAFINX.DLL, and two public-domain .DLL's, BMP2GIF.DLL and GIFUTIL.DLL, for converting a .BMP to a .GIF file.  IMPORTANT: BMP2GIF.DLL can only convert bitmaps with 256 colors (8 bits per pixel) or less, so therefore you must configure your Windows Server to a Graphics mode of 256 colors or less.  Any advice around this problem would be appreciated.  These libraries were written by Robert Denny, the author of O'Reilly's Website and the WinCGI interface, and placed in the public domain by him in December, 1994.  These DLL files are included with this package.
  11.  
  12.     This software is neither Freeware nor Shareware nor Commercialware.  I think of it as Beggarware, you are free to use it, duplicate it, and redistribute it, provided that you do so as a complete package, including this documentation, and without remuneration.  Like the music from a street musician, it is there for all to enjoy freely.  You may not make any money from it yourself, such as by resale.  I do ask that if you like it and use it, please throw some suitable amount into my laptop case.   A contribution of $5-$10 dollars is greatly appreciated so long as you are satisfied with and are using this program.   No registration is necessary, but I will keep track of all contributors.  Our mailing address for contributions is Hickory Hill Associates, 38 Hickory Hill Road, Plantsville, CT 06479, USA.  All rights not conferred explicitly by this document are reserved, copyright 1995, to Hickory Hill Associates.
  13.  
  14. II.  System Requirements and Installation.
  15.  
  16.     You can only use this software if your web page has access to a WinCGI server and its WinCGI program directory.   If you don't know what this is, you probably can't use it.   The Windows CGI is a Common Gateway Interface standard for Webservers operating in a Windows NT or Windows 95 environment.  It permits development of CGI programs in Visual Basic, rather than PERL.  Developed by Robert Denny for O'Reilly's Website, it uses files to communicate with the CGI program as opposed to STDIN and STDOUT.  WinCGI is an implementation of your Webserver software.  If your Webserver does not provide for a WinCGI interface, you will not be able to use this program.
  17.  
  18.     IMPORTANT: BMP2GIF.DLL can only convert 256 color (8 bits per pixel) or less bitmaps, so therefore you must configure your Windows Server Display Settings to a Graphics mode of 256 colors or less.
  19.  
  20.     If your Webserver does support WinCGI and your provider or site gives you access to WinCGI programs, then all you have to do is place one file wgizmo.exe into your WinCGI program directory and the four DLL files, vbrun300.dll, msafinx.dll, bmp2gif.dll, and gifutil.dll, into either your WinCGI program directory or your Windows\System directory.  In O'Reilly's Website, the WinCGI directory is usually c:\website\cgi-win\.  Please see your server documentation for the proper setup and use of the WinCGI available to your server.  You then place an appropriate <IMG SRC="/cgi-win-path/wgizmo.exe?parameter-string"> HTML tag in your webpage.   The parameter-string is described in detail below.  Whenever a browser requests the image, the WinCGI capable server will execute wgizmo.exe, which in turn creates a dynamic GIF file showing the requested information.  The image is returned through the WinCGI to the Webserver, which then passes the GIF along to the Browser.
  21.  
  22. III.  Parameters
  23.  
  24.     The default behavior of the gizmo is to increment a number in a file called "counter.dat" in the wgizmo.exe application directory and return the number as a GIF image.  The default image is an MS Sans Serif 12-point black on white text containing the number found in the "counter.dat" file.
  25.  
  26.     By passing an appropriate string of parameters to WinCGIzmo (tm), you can control the font, fontsize, bold, italics, foreground color and background color of the GIF image.  You can display a counter for multiple pages, today's date, current system time, the IP Address of the browser, the HostName of the browser, if available, days until or since a specific date, or a text string. The parameter string is placed after a "?"  following the wgizmo.exe in the <IMG SRC="..."> command line.  The WinCGI will pass these parameters as a Query String, in the [CGI] section of the WinCGI .INI file.  These parameters are not case sensitive, except for the text parameter, and may appear in any order.  You may not use spaces, the "#" sign, the "&" sign, and possibly an assortment of other strange characters.  These may cause the Webserver to truncate the Query String.  You can incorporate spaces by using the "_" character. When used in a fontname or text parameter, the gizmo will automatically replace the "_" character with a space.
  27.  
  28.  
  29.     Parameters are passed after a "?" following the wgizmo.exe command, in "key=value" pairs separated with an "&" character.  For example, the HTML tag <IMG SRC="/cgi-win/wgizmo.exe?action=text&text=WinCGIzmo_(TM),&bold=on&Font=Times_New_Roman&Fontsize=14&ForeColor=15&BackColor=9&italic=on"> will produce a white on blue text box with the words "WinCGIzmo (TM)," in a bold, italic, 14 point Times New Roman font.  The action parameter determines what type of information is displayed.  In this case, the gizmo displays the text string passed by the text key.
  30.  
  31. A. Actions
  32.  
  33. The WinCGIzmo supports 6 values for the action key: count, date, time, ipaddr, remotehost, and text.  You may use only one action at a time, but you may place the gizmo in your page more than once.  More than 3 or 4 calls to WinCGIzmo on a single HTML page is not advisable.  Also, according to Mr. Denny, Website will execute WinCGI programs more quickly if it is running as a console app rather than as a server.    
  34.  
  35.     1. action=count&pageid=filename
  36.  
  37.     The count action is the default and need not be present in the parameter string.  When using the count action, you may also use a "pageid=filename" key=value pair to identify a unique counter file to use.   The default is "counter.dat", but by using the pageid key, which must be 8 legal filename characters or less, you can keep counters for multiple independent pages.  If present, WinCGIzmo (tm) will use the file "pageid-value.dat" in the gizmo application directory to hold the counter.
  38.  
  39.     For example <IMG SRC="/cgi-win/wgizmo.exe?pageid=about"> will create a 12 point MS Sans Serif black on white box containing the number found in the file "about.dat" in the WinCGIzmo (tm) application directory.  You may use a text editor to edit, update, or reset the number.  If you delete the file, the gizmo will recreate it and reset the count to 1.  Do not use commas or Unicode in this file.
  40.  
  41.     2. action=days&date=#/#/####
  42.  
  43.     This action calculates and returns the number of days between today's date and the date value indicated by the date key.  If the date key is omitted, the default date is 12/31/1999.  The current day is included in the count.  The date may be before or after today's date, but WinCGIzmo (tm) will always return a positive number. 
  44.     
  45.     3. action=Date, action=time, action=ipaddr, action=remotehost.
  46.  
  47.     Respectively, these actions  place the system date, system time, remote IP address, and remote host name in the image.  Note that the remote host name is only available if you have Reverse DNS lookup enabled in your WebServer.  Even if you do, this function is remarkably inconsistent, at least in O'Reilly's Website. 
  48.  
  49.     4. action=text&text=textstring
  50.  
  51.     This action will place the textstring value for the text key into the image.  Use the "_" character to represents spaces.  Do not use the "&" character in the string or it will be truncated.  
  52.  
  53.  
  54. B. Fonts and Colors
  55.  
  56.     You may control the appearance of the image with 6 key=value pairs.  They are Font=fontname, Fontsize=fontsize, ForeColor=colornumber, BackColor=colornumber, bold=on, and italic=on.  They are all optional, may appear in any order, and are case insensitive.  
  57.  
  58.     1. Font
  59.  
  60.     You may use any Fontname available to Visual Basic on your system.  You must type it precisely, replacing spaces with the "_" character, e.g. font=Times_New_Roman.  
  61.     
  62.     2. Fontsize
  63.  
  64.     Fontsize must be between 8 and 48 point, e.g fontsize=14.  The default size is 12.
  65.  
  66.     3. Bold=on&italic=on
  67.     
  68.     The default is off.  You may set either or both to on in order to change the appearance of the text in the image.
  69.  
  70.     4. ForeColor and BackColor
  71.     
  72.     For simplicity's sake, I have restricted colors to the 16 colors provided by the QBColor Visual Basic command. They are:
  73.      
  74.      0=Black
  75.      1=Blue
  76.      2=Green
  77.      3=Cyan
  78.      4=Red
  79.      5=Magenta
  80.      6=Yellow
  81.      7=White
  82.      8=Gray
  83.      9=Light Blue
  84.     10=Light Green
  85.     11=Light Cyan
  86.     12=Light Red
  87.     13=Light Magenta
  88.     14=Light Yellow
  89.     15=Bright White
  90.  
  91.     For Example, forecolor=15&backcolor=9, will produce white text on a light blue background.  The default is black on white.
  92.  
  93. V.  Software is AS-IS with no Warranties of any kind, etc.
  94.  
  95.     WinCGIzmo (TM) is a trademark of Hickory Hill Associates.  You may only use the trademark as part of a credit or copyright notice in connection with the use of this software.  All other use of the trademark is prohibited.
  96.  
  97.     THIS SOFTWARE IS PROVIDED AS-IS. HICKORY HILL ASSOCIATES MAKES NO WARRANTIES EXPRESS OR IMPLIED OF ANY KIND WITH RESPECT TO THIS SOFTWARE, INCLUDING, WITHOUT LIMITATION, AS TO NON-INFRINGEMENT OR THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE.  IN NO EVENT WILL HICKORY HILL ASSOCIATES BE LIABLE TO YOU FOR ANY DAMAGES, CONSEQUENTIAL, INCIDENTAL, SPECIAL OR OTHERWISE, INCLUDING ANY LOST PROFITS OR LOST SAVINGS, EVEN IF REPRESENTATIVES OF SUCH PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY THIRD PARTY WHATSOEVER. ALL USES OF THIS SOFTWARE ARE DONE AT THE USER'S OWN RISK.
  98.  
  99. VI.  Thank you.
  100.  
  101.     Now that the disclaimers are over with, Hickory Hill Associates would like to thank you again for trying the WinCGIzmo (tm) or, at the very least, reading this far. Any contributions or suggestions are appreciated.  You can reach us at:
  102.  
  103. Hickory Hill Associates
  104. 38 Hickory Hill Road
  105. Plantsville, CT 06479
  106. USA
  107.  
  108. Phone: 1-860-621-2626
  109. E-Mail: coppage@hickoryhill.com
  110. WWW: http://www.hickoryhill.com/
  111.   
  112. Copyright 1995, Hickory Hill Associates, All Rights Reserved.